import { Entity, Column, PrimaryGeneratedColumn, Index } from "typeorm";
import { BaseEntity } from "./base";

@Entity({ name: "sys_user" })
export class UserModel extends BaseEntity {
  @PrimaryGeneratedColumn()
  id: number;
  @Column({ length: 20, type: "varchar", comment: "账号" })
  @Index()
  username: string;
  @Column({ length: 32, type: "varchar", comment: "密码" })
  password: string;
  @Column({ length: 20, type: "varchar", comment: "姓名" })
  nickname: string;
  @Column({ length: 20, type: "varchar", nullable: true })
  phone: string;
  @Column({ type: "int", comment: "角色" })
  role: number;
  @Column({ length: 30, type: "varchar", nullable: true })
  department: string;
}
